<?xml version="1.0"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core">
<h:body>
	<ui:composition template="templates/applicationTemplate.xhtml">

		<ui:define name="content">
			<h:outputStylesheet library="css" name="content.css" target="body" />
			<h2>
				<h:outputText value="Haus hinzügen"></h:outputText>
			</h2>
			<h:form id="addHouseForm" acceptcharset="ISO-8859-1">
				<div class="addHouseEntry">
					<h:panelGroup id="rowStreetAndHouseNr">
						<h:outputLabel value="Straße:"></h:outputLabel>
						<h:inputText
							id="inputStreet"
							styleClass="inputFieldLong"
							value="#{haeuserBean.haus.strasse}"
							label="Straße">
							<f:validateRequired></f:validateRequired>
							<f:validateLength maximum="50"></f:validateLength></h:inputText>
						<h:outputLabel value="Hausnr.:"></h:outputLabel>
						<h:inputText
							id="inputHouseNr" 
							styleClass="inputFieldShort"
							value="#{haeuserBean.haus.hausnr}"
							label="Hausnr.">
							<f:validateRequired></f:validateRequired>
							<f:validateLength maximum="7"></f:validateLength></h:inputText>
					</h:panelGroup>
				</div>
				<div class="addHouseEntry">
					<h:panelGroup id="rowPostcodeAndCity">
						<h:outputLabel value="PLZ:"></h:outputLabel>
						<h:inputText
							id="inputPostcode" 
							styleClass="inputFieldShort"
							value="#{haeuserBean.haus.plz}"
							label="PLZ">
							<f:validateRequired></f:validateRequired>
							<f:validateLength maximum="5" minimum="5"></f:validateLength>
							<f:validateLongRange minimum="10000" maximum="99999"></f:validateLongRange></h:inputText>
						<h:outputLabel value="Ort:"></h:outputLabel>
						<h:inputText
							id="inputCity" 
							styleClass="inputFieldLong"
							value="#{haeuserBean.haus.ort}"
							label="Ort">
							<f:validateRequired></f:validateRequired>
							<f:validateLength maximum="50"></f:validateLength>
							</h:inputText>
					</h:panelGroup>
				</div>
				<h:messages 
					styleClass="errorMessage"></h:messages>
				<h:commandButton 
					value="Speichern" 
					styleClass="buttonAddHouse" 
					action="#{haeuserBean.save}"></h:commandButton>
				<h:commandButton 
					value="Abbrechen" 
					styleClass="buttonAddHouse"
					action="haeuser"></h:commandButton>

			</h:form>
		</ui:define>
	</ui:composition>
</h:body>
</html>
